package com.finger.modelservice.vo.acl;

import com.zaxxer.hikari.util.UtilityElf;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.*;
import java.util.stream.Collectors;

@Data
public class AssignVo {

    private Long roleId;

    private Long[] permissionId;

    public static void main(String[] args) {
        //        List<String> list = Arrays.asList("Tom","Bob","Aba","Ana","Tom");
        //        // 一行代码把集合中所有的Tom去除，并返回一个新的集合
        //        List<String> list1 = list.stream().filter(item -> !item.equals("Tom")).collect(Collectors.toList());
//        ThreadPoolExecutor executor = new ThreadPoolExecutor(1, 5, 300, TimeUnit.SECONDS, new LinkedBlockingQueue<>(100));
        FutureTask<String> task = new FutureTask<>(() -> {
            return "Hello";
        });
        Runnable cal = ()->{
            System.out.println(Thread.currentThread().isDaemon());
            try {
                Thread.sleep(10000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        };

        try {
            TimeUnit.SECONDS.sleep(1);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }


        System.out.println(888);
        System.out.println(111);
        new Thread(task,"线程一").start();
        Thread thread = new Thread(cal, "线程二");
        thread.setDaemon(true);
        thread.start();

    }

    @Data
    // 可以链式调用设置属性
    @Accessors(chain = true)
    static class Stu{
        private String name;
        private Integer age;

    }


}
